from enum import Enum

class StatusCodeEnum(Enum):
    
    OK = (0,"成功")
    ERROR = (-1,"错误")
    WARNING = (-2,"警告")
    SERVER_ERR = (500,"服务器异常")
    NO_LOGIN_ERR = (4000, "用户未登录")
    PUBLIC_ADDRESS_ERR = (4001,"用户信息异常")
    SIGN_ERROR = (4005,"签名错误")
    WAIT_PAY = (4006,"等待支付")
    PARAM_ERROR = (4007,"参数错误")
    
    DB_ERR = (5000,"数据库错误")
    
    @property
    def code(self):
        return self.value[0]

    @property
    def errmsg(self):
        return self.value[1]
    
    